import request from '@js/request'

export function login(data) {
  return request({
    url: '/common/login',
    method: 'post',
     data,
     _transformRequest:true,
    //baseURL: process.env.VUE_APP_BASE_API
  })
}

export function forgetPassword(data) {
  return request({
    url: '/forgot/send/email',
    method: 'post',
    params: data,
    //baseURL: process.env.VUE_APP_BASE_API
  })
}

export function resetPassword(data) {
  return request({
    url: '/forgot/modify/paw',
    method: 'post',
    params: data,
    //baseURL: process.env.VUE_APP_BASE_API
  })
}

export function getInfo(token) {
  return request({
    url: '/home/profile',
    method: 'post',
    params: { token },
    //baseURL: process.env.VUE_APP_BASE_API,
  })
}

export function getProfileInfo(data) {
  return request({
    url: '/home/member/profile',
    method: 'post',
    params: data,
    //baseURL: process.env.VUE_APP_BASE_API,
  })
}

export function getUserInfo(params) {
  return request({
    url: '/setting/query/user_info',
    method: 'post',
    params
  })
}

export function logout(token) {
  return request({
    url: '/setting/logout',
    method: 'post',
    params: { token },
    //baseURL: process.env.VUE_APP_BASE_API
  })
}
